package com.itgaoshu.hospitalproject.mapper;

import com.itgaoshu.hospitalproject.bean.Drugdictionary;
import com.itgaoshu.hospitalproject.bean.Drugstore;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface PutinMapper {
    //一点击药品上的按钮就出来药品清单
    List<Drugdictionary> selectyaopin(Drugdictionary drugdictionary);
   @Select("select sum(drugstorenum) from drugstore where drugstoreName=#{drugstoreName}")
   int selnumber(Drugstore drugstore);
   int  adddrugstore(Drugstore drugstore);
   @Select("select count(*) from drugstore where  drugstoreName=#{drugstoreName} and batch=#{batch}")
   int selectdrugsBydrugstorename(Drugstore drugstore);
   @Update("update drugstore set drugstorenum=drugstorenum+#{drugstorenum} where batch=#{batch}")
   int  updatedrugs(Drugstore drugstore);
}
